<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>往来收款及核销</title>
	<include file="Public:header" />
	<style type="text/css">
		.input{width:150px;border:1px solid #ccc;padding:2px;}
	</style>
	<script type="text/javascript">
		var actflg="{:C('URL_MODEL')}"=="0"?"&":"?";
		function data_status_to_a()
		{
			var selChk="";
			//遍历得到每个checkbox的value值
			$("input[name='chk_list']").each(function(){
				if(this.checked){selChk+=this.value+",";}				
			});
			selChk+="0";
			if(selChk=="0")
			{
				$.messager.show({title:'提示',msg:'没有选中要启用的项',timeout:5000,showType:'slide'});
			}
			else
			{
				$.messager.confirm('询问', '确认要启用选中的项吗？', function(r){
					if (r){
						//todo...
						window.location.href="{:U('Finance/facheck_status_to_a')}"+actflg+"id="+selChk+"";
					}
				});
			}
		}
		
		function data_status_to_c()
		{
			var selChk="";
			//遍历得到每个checkbox的value值
			$("input[name='chk_list']").each(function(){
				if(this.checked){selChk+=this.value+",";}				
			});
			selChk+="0";
			if(selChk=="0")
			{
				$.messager.show({title:'提示',msg:'没有选中要取消的项',timeout:5000,showType:'slide'});
			}
			else
			{
				$.messager.confirm('询问', '确认要取消选中的项吗？', function(r){
					if (r){
						//todo...
						window.location.href="{:U('Finance/facheck_status_to_c')}"+actflg+"id="+selChk+"";
					}
				});
			}
		}
		function selectall_todo()
		{
			$("input[name='chk_list']").attr("checked",true);
		}
		function selectall_undo()
		{
			$("input[name='chk_list']").attr("checked",false);
		}
		$(document).ready(function(){
			$('#misone_list_table').datagrid({
				//url: '///',
				//title: 'DataGrid',
				//width: 800,
				//height: 220,
				fitColumns: true,
				nowrap:false,
				rownumbers:true,
				showFooter:false,
				columns:[[
					{field:'col01',title:'选择',width:20},
					{field:'col02',title:'ID',width:40},
					{field:'col03',title:'单号',width:80}, //,align:'right'
					{field:'col04',title:'日期',width:80},
					{field:'col05',title:'客户',width:120},
					{field:'col06',title:'摘要',width:130},
					{field:'col07',title:'状态',width:40,align:'center'},
					{field:'col08',title:'操作',width:40,align:'center'},
					{field:'col09',title:'日志',width:130}
				]]
			});
		});
	</script>
</head>
<body class="">
	<div class="demo-info space-out-5px">
		<div class="demo-tip icon-tip"></div>
		<div>往来收款及核销</div>
		<div>
		<form id="frm_search" method="post" action="{:U('Finance/fa_checkin_list')}" style="margin:10px auto 0px 25px;">
		<div style="float:left; margin:0px; padding:2px;">
		<select id="s_status_flg" name="s_status_flg" class="easyui-combobox" editable="false" style="width:100px;">
								<option value=''>所有状态</option>								
								<option value='A'>活动中</option>
								<option value='P'>已过账</option>
								<option value='C'>已取消</option>
								
		</select>		
		</div>
		<script type="text/javascript">$("#s_status_flg").attr("value","{$s_status_flg}");</script>
		<input type="text" id="keywords" name="keywords" class="input" value="{$keywords}" />
		<a href="javascript:;" class="easyui-linkbutton" iconCls="icon-search" onclick="$('#frm_search').submit();">搜索</a>
		<a href="{:U('Finance/fa_checkin_list')}" class="easyui-linkbutton" iconCls="icon-reload">显示所有</a>
		<a href="{:U('Finance/fa_checkin_add')}" class="easyui-linkbutton" iconCls="icon-add">新增加</a>
		</form>
		</div>
	</div>
	
	<div class="list-box space-out-5px">
	
	<table id="misone_list_table"><tbody>
	<volist name="datalist" id="datalist">
	<tr>
		<td field="col01"><if condition="($datalist['status_flg'] eq 'A') OR ($datalist['status_flg'] eq 'C')">
			<input type="checkbox" name="chk_list" value="{$datalist.id}" style="margin-top:6px;" />
			</if>
		</td>
		<td field="col02">{$datalist.id}</td>
		<td field="col03">{$datalist.mas_no}</td>
		<td field="col04">{$datalist.fadate|date='Y-m-d',###}</td>
		<td field="col05"><span alt="{$datalist.customer_title}" title="{$datalist.customer_title}">{$datalist.customer_title}</span></td>
		<td field="col06"><span alt="{$datalist.remark}" title="{$datalist.remark}">{$datalist.remark}</span></td>
		<td field="col07">{$datalist.status_flg|get_status_title=###,true}</td>
		<td field="col08"><if condition="$datalist['status_flg'] eq 'A'">
			<a href="{:U('Finance/fa_checkin_edit?id='.$datalist['id'].'')}">编辑</a>
			<else />
			<a href="{:U('Finance/fa_checkin_edit?id='.$datalist['id'].'')}">查看</a>
			</if>
		</td>
		<td field="col09"><if condition="$datalist['status_flg'] eq 'P'">
			[{$datalist.poster_username}/{$datalist.posttime|date='Y-m-d',###}过账]<br />
			</if>
			[{$datalist.creater_username}/{$datalist.createtime|date='Y-m-d',###}做单]
		</td>
	</tr>
	</volist>
	</tbody></table>
	
	<div style="height:5px; clear:both;"></div>
	
	</div>
	
	
	<div class="space-out-5px">
	
		
	<div class="list-title">
		<div class="list-t-l">操作：<a href="javascript:;" onclick="selectall_todo()">全选</a> - <a href="javascript:;" onclick="selectall_undo()">取消选择</a>
		- <a href="javascript:;" onclick="data_status_to_a()">启用</a>
		- <a href="javascript:;" onclick="data_status_to_c()">取消</a>
		</div>
		<div class="list-t-r">
		<a href="{:U('Finance/fa_checkin_add')}" class="easyui-linkbutton" iconCls="icon-add">新增加</a>
		</div>
	</div>
	
	
	</div>
	
	<div class="demo-info space-out-5px">
		<div class="demo-tip icon-tip"></div>
		<div class="pages">&nbsp;{$page}</div>
	</div>
</body>
</html>
